package com.softlook.mt.server.db.internal;

import java.lang.String;
import java.util.Hashtable;
import java.lang.Integer;
import jp.crossfire.framework.database.ICondition;
import jp.crossfire.framework.database.ConditionContainer;
import jp.crossfire.framework.database.Condition;

public class GpsdataManagerInternal {
	public String getSql(Hashtable input, Integer limit, Integer offset) {
		return null;
	}
	protected ICondition getGetCondition(Hashtable input) {
		// Condition
		ICondition cnd0= new ConditionContainer("AND");
		ICondition cnd1= new Condition("gpsdataid = '$gpsdataid'");
		if(input.get("gpsdataid") != null){
			((Condition)cnd1).getProperties().put("gpsdataid", input.get("gpsdataid"));
		}
		((ConditionContainer)cnd0).addChild(cnd1);
		ICondition cnd2= new Condition("deviceid = '$deviceid'");
		if(input.get("deviceid") != null){
			((Condition)cnd2).getProperties().put("deviceid", input.get("deviceid"));
		}
		((ConditionContainer)cnd0).addChild(cnd2);
		ICondition cnd3= new Condition("time >= '$timefrom'");
		if(input.get("timefrom") != null){
			((Condition)cnd3).getProperties().put("timefrom", input.get("timefrom"));
		}
		((ConditionContainer)cnd0).addChild(cnd3);
		ICondition cnd4= new Condition("time <= '$timeto'");
		if(input.get("timeto") != null){
			((Condition)cnd4).getProperties().put("timeto", input.get("timeto"));
		}
		((ConditionContainer)cnd0).addChild(cnd4);
		ICondition cnd5= new Condition("gpsdataid >= '$gpsdataidfrom'");
		if(input.get("gpsdataidfrom") != null){
			((Condition)cnd5).getProperties().put("gpsdataidfrom", input.get("gpsdataidfrom"));
		}
		((ConditionContainer)cnd0).addChild(cnd5);
		ICondition cnd6= new Condition("gpsdataid <= '$gpsdataidto'");
		if(input.get("gpsdataidto") != null){
			((Condition)cnd6).getProperties().put("gpsdataidto", input.get("gpsdataidto"));
		}
		((ConditionContainer)cnd0).addChild(cnd6);
		return cnd0;
	}
	protected ICondition getGetHavingCondition(Hashtable input) {
		// Condition
		return null;
	}
	protected ICondition setGetCondition(Hashtable input) {
		// Condition
		return null;
	}
	public String getLastSql(Hashtable input, Integer limit, Integer offset) {
		return null;
	}
	protected ICondition getLastGetCondition(Hashtable input) {
		// Condition
		ICondition cnd0= new ConditionContainer("AND");
		ICondition cnd1= new Condition("gpsdataid = (select max(gpsdataid) from gpsdata where deviceid='$deviceid')");
		if(input.get("deviceid") != null){
			((Condition)cnd1).getProperties().put("deviceid", input.get("deviceid"));
		}
		((ConditionContainer)cnd0).addChild(cnd1);
		return cnd0;
	}
	protected ICondition getLastGetHavingCondition(Hashtable input) {
		// Condition
		return null;
	}
}
